package models

import (
	"github.com/goravel/framework/database/orm"
)

type Refillcard struct {
	orm.Model
	UserID   uint   `gorm:"column:user_id;type:int(11);default:null;constraint:OnUpdate:CASCADE,OnDelete:SET NULL; comment:'由谁获得'" form:"user_id" json:"user_id"`
	UserName string `gorm:"column:user_name;type:varchar(255);not null;default:'';comment:'拥有者'" form:"user_name" json:"user_name"`
	Secret   string `gorm:"column:secret;type:varchar(255);not null" form:"secret" json:"secret"`
	Unit     string `gorm:"column:unit;type:int(11);not null; comment:'单位'" form:"unit" json:"unit"`
	State    int    `gorm:"column:state;type:int(11);not null;default:0" form:"state" json:"state"` //0未使用，1已使用
	orm.SoftDeletes
}

// TableName sets the insert table name for this struct type
func (r *Refillcard) TableName() string {
	return "refillcards"
}
